<template>
	<view class="disalog-box" @touchmove.stop.prevent="moveHandle">
		<view class="disalog-content">
			<view class="disalog-title">
				物料信息
			</view>
			<view class="content-box">
				<view class="title-item">
					名称
				</view>
				<view class="value-item" style="color:#ff4400;">
					{{info.materialName}}
				</view>
				<view class="title-item">
					简称
				</view>
				<view class="value-item">
					{{info.materialShortName ? info.materialShortName : ''}}{{info.shortName ? info.shortName : ''}}
				</view>
				<view class="title-item">
					编号
				</view>
				<view class="value-item">
					{{info.materialNo}}
				</view>
				<view class="sign-tag">
					{{info.unit ? info.unit : ''}}{{info.materialUnit ? info.materialUnit :''}}{{info.twoUnit ? '/' + info.twoUnit : ''}}
				</view>
				<view class="table-box">
					<view class="table-row th">
						<view class="table-cell">
							序号
						</view>
						<view class="table-cell">
							属性
						</view>
						<view class="table-cell">
							属性值
						</view>
					</view>
					<view class="table-row" v-for="(item,index) in info.paramArr" :key="index">
						<view class="table-cell">
							{{index + 1}}
						</view>
						<view class="table-cell">
							{{item.unit}}
						</view>
						<view class="table-cell">
							{{item.value}}
						</view>
					</view>
				</view>
				<view class="button" @click="close">
					关闭
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			info:{
				type:Object,
				default:{}
			},
		},
		data() {
			return {
				
			}
		},
		mounted(){
			console.log(this.info.paramArr);
		},
		methods: {
			moveHandle(){
				return;
			},
			close:function(){
				this.$emit('close');
			},
		}
	}
</script>

<style lang="scss" scoped>
	.disalog-box{
		width: 100%;
		height: 100vh;
		position: fixed;
		top: 0;
		left: 0;
		background: rgba(0,0,0,0.6);
		.disalog-content{
			background-color: white;
			border-radius: 10rpx;
			position: absolute;
			top:50%;
			left: 50%;
			animation-name: disalogshow;
			animation-duration:1s;
			width: calc(100% - 20rpx);
			transform: translate(-50%,-50%);
			box-sizing: border-box;
			padding: 20rpx;
			.disalog-title{
				text-align: center;
			}
			.content-box{
				font-size: 28rpx;
				line-height:50rpx;
				.title-item{
					font-weight: bold;
				}
				.value-item{
					color:#6a5acd;
					padding-left:40rpx;
				}
				.sign-tag{
					background-color: #eaeaea;
					border-radius: 10rpx;
					line-height: 70rpx;
					color:#6a5acd;
					padding:0 40rpx;
				}
				.table-box{
					display: table;
					width: 100%;
					border-radius:10rpx 10rpx 0 0;
					margin: 20rpx 0;
					overflow: hidden;
					.table-row{
						display: table-row;
					}
					.table-cell{
						text-align: center;
						display: table-cell;
						background-color: #d0f0fd;
					}
					.th{
						
						
						.table-cell{
							background-color: #1793c6;
							color: white;
						}
					}
				}
				.button{
					background-color: #35af86;
					color: white;
					line-height: 70rpx;
					text-align: center;
					border-radius: 10rpx;
					margin-top: 60rpx;
				}
			}
		}
		
	}
	@keyframes disalogshow {
		0% {
			transform:translate(-50%,-60%);
			// transform: scale(0);
			opacity: 0;
		}
	
		100% {
			transform: translate(-50%,-50%);
			// transform: scale(1);
			opacity: 1;
		}
	}
</style>
